<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateQhSchoolArticlesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('qh_school_articles', function (Blueprint $table) {
            $table->id();
            $table->integer('schoolId', false, true)->nullable()->comment('学校Id');
            $table->string('province')->nullable()->comment('所属省份');
            $table->string('title')->comment('标题');
            $table->string('image')->nullable()->comment('图片');
            $table->string('abs')->nullable()->comment('摘要');
            $table->string('source')->nullable()->comment('来源');
            $table->tinyInteger('type')->comment('类型，1：招生简章，2：资讯');
            $table->text('content')->nullable()->comment('内容');
            $table->integer('readCount')->nullable(0)->comment('阅读次数');
            $table->timestamps();
        });

        DB::statement("ALTER TABLE qh_school_articles comment '学校文章'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('qh_school_articles');
    }
}
